home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / greps.zip / TESTS / REGRESS.SH < prev    next >
Linux/UNIX/POSIX Shell Script  |  1993-09-17  |  565b  |  31 lines

  1. #! /bin/sh
  2. # Regression test for GNU e?grep.
  3. # Usage: regress.sh [dir-containing-egrep]
  4.  
  5. builddir=${1-..}
  6.  
  7. failures=0
  8.  
  9. # The Khadafy test is brought to you by Scott Anderson . . .
  10. $builddir/egrep -f khadafy.regexp khadafy.lines > khadafy.out
  11. if cmp khadafy.lines khadafy.out
  12. then
  13.     rm khadafy.out
  14. else
  15.     echo Khadafy test failed -- output left on khadafy.out
  16.     failures=1
  17. fi
  18.  
  19. # . . . and the following by Henry Spencer.
  20.  
  21. awk -F: -f scriptgen.awk spencer.tests > tmp.script
  22.  
  23. if sh tmp.script $builddir
  24. then
  25.     rm tmp.script
  26.     exit $failures
  27. else
  28.     rm tmp.script
  29.     exit 1
  30. fi
  31.